home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 December / 2004-12 CHIP.iso / CHIP / Porady / Srodowisko PHP-MySQL / ACTIVESTATE PERL ADD-ON / PERL_add-on.exe / {app} / perl / bin / perlcc.bat < prev    next >
DOS Batch File  |  2004-08-02  |  19KB  |  667 lines

  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S %0 %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
  11. goto endofperl
  12. @rem ';
  13. #!perl
  14. #line 15
  15.     eval 'exec c:\wamp\perl\\bin\perl.exe -S $0 ${1+"$@"}'
  16.     if $running_under_some_shell;
  17. --$running_under_some_shell;
  18.  
  19. # Version 2.0, Simon Cozens, Thu Mar 30 17:52:45 JST 2000 
  20. # Version 2.01, Tom Christiansen, Thu Mar 30 08:25:14 MST 2000
  21. # Version 2.02, Simon Cozens, Sun Apr 16 01:53:36 JST 2000
  22. # Version 2.03, Edward Peschko, Mon Feb 26 12:04:17 PST 2001
  23. # Version 2.04, Enache Adrian,Fri, 18 Jul 2003 23:15:37 +0300
  24.  
  25. use strict;
  26. use warnings;
  27. use 5.006_000;
  28.  
  29. use FileHandle;
  30. use Config;
  31. use Fcntl qw(:DEFAULT :flock);
  32. use File::Temp qw(tempfile);
  33. use Cwd;
  34. our $VERSION = 2.04;
  35. $| = 1;
  36.  
  37. $SIG{INT} = sub { exit(); }; # exit gracefully and clean up after ourselves.
  38.  
  39. use subs qw{
  40.     cc_harness check_read check_write checkopts_byte choose_backend
  41.     compile_byte compile_cstyle compile_module generate_code
  42.     grab_stash parse_argv sanity_check vprint yclept spawnit
  43. };
  44. sub opt(*); # imal quoting
  45. sub is_win32();
  46. sub is_msvc();
  47.  
  48. our ($Options, $BinPerl, $Backend);
  49. our ($Input => $Output);
  50. our ($logfh);
  51. our ($cfile);
  52. our (@begin_output); # output from BEGIN {}, for testsuite
  53.  
  54. # eval { main(); 1 } or die;
  55.  
  56. main();
  57.  
  58. sub main {
  59.     parse_argv();
  60.     check_write($Output);
  61.     choose_backend();
  62.     generate_code();
  63.     run_code();
  64.     _die("XXX: Not reached?");
  65. }
  66.  
  67. #######################################################################
  68.  
  69. sub choose_backend {
  70.     # Choose the backend.
  71.     $Backend = 'C';
  72.     if (opt(B)) {
  73.         checkopts_byte();
  74.         $Backend = 'Bytecode';
  75.     }
  76.     if (opt(S) && opt(c)) {
  77.         # die "$0: Do you want me to compile this or not?\n";
  78.         delete $Options->{S};
  79.     }
  80.     $Backend = 'CC' if opt(O);
  81. }
  82.  
  83.  
  84. sub generate_code { 
  85.  
  86.     vprint 0, "Compiling $Input";
  87.  
  88.     $BinPerl  = yclept();  # Calling convention for perl.
  89.  
  90.     if (opt(shared)) {
  91.         compile_module();
  92.     } else {
  93.         if ($Backend eq 'Bytecode') {
  94.             compile_byte();
  95.         } else {
  96.             compile_cstyle();
  97.         }
  98.     }
  99.     exit(0) if (!opt('r'));
  100. }
  101.  
  102. sub run_code {
  103.     vprint 0, "Running code";
  104.     run("$Output @ARGV");
  105.     exit(0);
  106. }
  107.  
  108. # usage: vprint [level] msg args
  109. sub vprint {
  110.     my $level;
  111.     if (@_ == 1) {
  112.         $level = 1;
  113.     } elsif ($_[0] =~ /^\d$/) {
  114.         $level = shift;
  115.     } else {
  116.         # well, they forgot to use a number; means >0
  117.         $level = 0;
  118.     } 
  119.     my $msg = "@_";
  120.     $msg .= "\n" unless substr($msg, -1) eq "\n";
  121.     if (opt(v) > $level)
  122.     {
  123.          print        "$0: $msg" if !opt('log');
  124.      print $logfh "$0: $msg" if  opt('log');
  125.     }
  126. }
  127.  
  128. sub parse_argv {
  129.  
  130.     use Getopt::Long; 
  131.  
  132.     # disallows using long arguments
  133.     # Getopt::Long::Configure("bundling");
  134.  
  135.     Getopt::Long::Configure("no_ignore_case");
  136.  
  137.     # no difference in exists and defined for %ENV; also, a "0"
  138.     # argument or a "" would not help cc, so skip
  139.     unshift @ARGV, split ' ', $ENV{PERLCC_OPTS} if $ENV{PERLCC_OPTS};
  140.  
  141.     $Options = {};
  142.     Getopt::Long::GetOptions( $Options,
  143.         'L:s',          # lib directory
  144.         'I:s',          # include directories (FOR C, NOT FOR PERL)
  145.         'o:s',          # Output executable
  146.         'v:i',          # Verbosity level
  147.         'e:s',          # One-liner
  148.     'r',            # run resulting executable
  149.         'B',            # Byte compiler backend
  150.         'O',            # Optimised C backend
  151.         'c',            # Compile only
  152.         'h',            # Help me
  153.         'S',            # Dump C files
  154.     'r',            # run the resulting executable
  155.         'T',            # run the backend using perl -T
  156.         't',            # run the backend using perl -t
  157.         'static',       # Dirty hack to enable -shared/-static
  158.         'shared',       # Create a shared library (--shared for compat.)
  159.     'log:s',        # where to log compilation process information
  160.         'Wb:s',         # pass (comma-sepearated) options to backend
  161.         'testsuite',    # try to be nice to testsuite
  162.     );
  163.  
  164.     $Options->{v} += 0;
  165.  
  166.     if( opt(t) && opt(T) ) {
  167.         warn "Can't specify both -T and -t, -t ignored";
  168.         $Options->{t} = 0;
  169.     }
  170.  
  171.     helpme() if opt(h); # And exit
  172.  
  173.     $Output = opt(o) || ( is_win32 ? 'a.exe' : 'a.out' );
  174.     $Output = is_win32() ? $Output : relativize($Output);
  175.     $logfh  = new FileHandle(">> " . opt('log')) if (opt('log'));
  176.  
  177.     if (opt(e)) {
  178.         warn "$0: using -e 'code' as input file, ignoring @ARGV\n" if @ARGV;
  179.         # We don't use a temporary file here; why bother?
  180.         # XXX: this is not bullet proof -- spaces or quotes in name!
  181.         $Input = is_win32() ? # Quotes eaten by shell
  182.             '-e "'.opt(e).'"' :
  183.             "-e '".opt(e)."'";
  184.     } else {
  185.         $Input = shift @ARGV;  # XXX: more files?
  186.         _usage_and_die("$0: No input file specified\n") unless $Input;
  187.         # DWIM modules. This is bad but necessary.
  188.         $Options->{shared}++ if $Input =~ /\.pm\z/;
  189.         warn "$0: using $Input as input file, ignoring @ARGV\n" if @ARGV;
  190.         check_read($Input);
  191.         check_perl($Input);
  192.         sanity_check();
  193.     }
  194.  
  195. }
  196.  
  197. sub opt(*) {
  198.     my $opt = shift;
  199.     return exists($Options->{$opt}) && ($Options->{$opt} || 0);
  200.  
  201. sub compile_module { 
  202.     die "$0: Compiling to shared libraries is currently disabled\n";
  203. }
  204.  
  205. sub compile_byte {
  206.     my $command = "$BinPerl -MO=Bytecode,-H,-o$Output $Input";
  207.     $Input =~ s/^-e.*$/-e/;
  208.  
  209.     my ($output_r, $error_r) = spawnit($command);
  210.  
  211.     if (@$error_r && $? != 0) {
  212.     _die("$0: $Input did not compile:\n@$error_r\n");
  213.     } else {
  214.     my @error = grep { !/^$Input syntax OK$/o } @$error_r;
  215.     warn "$0: Unexpected compiler output:\n@error" if @error;
  216.     }
  217.  
  218.     chmod 0777 & ~umask, $Output    or _die("can't chmod $Output: $!");
  219.     exit 0;
  220. }
  221.  
  222. sub compile_cstyle {
  223.     my $stash = grab_stash();
  224.     my $taint = opt(T) ? '-T' :
  225.                 opt(t) ? '-t' : '';
  226.  
  227.     # What are we going to call our output C file?
  228.     my $lose = 0;
  229.     my ($cfh);
  230.     my $testsuite = '';
  231.     my $addoptions = opt(Wb);
  232.  
  233.     if( $addoptions ) {
  234.         $addoptions .= ',' if $addoptions !~ m/,$/;
  235.     }
  236.  
  237.     if (opt(testsuite)) {
  238.         my $bo = join '', @begin_output;
  239.         $bo =~ s/\\/\\\\\\\\/gs;
  240.         $bo =~ s/\n/\\n/gs;
  241.         $bo =~ s/,/\\054/gs;
  242.         # don't look at that: it hurts
  243.         $testsuite = q{-fuse-script-name,-fsave-data,-fsave-sig-hash,}.
  244.             qq[-e"print q{$bo}",] .
  245.             q{-e"open(Test::Builder::TESTOUT\054 '>&STDOUT') or die $!",} .
  246.             q{-e"open(Test::Builder::TESTERR\054 '>&STDERR') or die $!",};
  247.     }
  248.     if (opt(S) || opt(c)) {
  249.         # We need to keep it.
  250.         if (opt(e)) {
  251.             $cfile = "a.out.c";
  252.         } else {
  253.             $cfile = $Input;
  254.             # File off extension if present
  255.             # hold on: plx is executable; also, careful of ordering!
  256.             $cfile =~ s/\.(?:p(?:lx|l|h)|m)\z//i;
  257.             $cfile .= ".c";
  258.             $cfile = $Output if opt(c) && $Output =~ /\.c\z/i;
  259.         }
  260.         check_write($cfile);
  261.     } else {
  262.         # Don't need to keep it, be safe with a tempfile.
  263.         $lose = 1;
  264.         ($cfh, $cfile) = tempfile("pccXXXXX", SUFFIX => ".c"); 
  265.         close $cfh; # See comment just below
  266.     }
  267.     vprint 1, "Writing C on $cfile";
  268.  
  269.     my $max_line_len = '';
  270.     if ($^O eq 'MSWin32' && $Config{cc} =~ /^cl/i) {
  271.         $max_line_len = '-l2000,';
  272.     }
  273.  
  274.     # This has to do the write itself, so we can't keep a lock. Life
  275.     # sucks.
  276.     my $command = "$BinPerl $taint -MO=$Backend,$addoptions$testsuite$max_line_len$stash,-o$cfile $Input";
  277.     vprint 1, "Compiling...";
  278.     vprint 1, "Calling $command";
  279.  
  280.     my ($output_r, $error_r) = spawnit($command);
  281.     my @output = @$output_r;
  282.     my @error = @$error_r;
  283.  
  284.     if (@error && $? != 0) {
  285.         _die("$0: $Input did not compile, which can't happen:\n@error\n");
  286.     }
  287.  
  288.     is_msvc ?
  289.         cc_harness_msvc($cfile,$stash) :
  290.         cc_harness($cfile,$stash) unless opt(c);
  291.  
  292.     if ($lose) {
  293.         vprint 2, "unlinking $cfile";
  294.         unlink $cfile or _die("can't unlink $cfile: $!"); 
  295.     }
  296. }
  297.  
  298. sub cc_harness_msvc {
  299.     my ($cfile,$stash)=@_;
  300.     use ExtUtils::Embed ();
  301.     my $obj = "${Output}.obj";
  302.     my $compile = ExtUtils::Embed::ccopts." -c -Fo$obj $cfile ";
  303.     my $link = "-out:$Output $obj";
  304.     $compile .= " -I".$_ for split /\s+/, opt(I);
  305.     $link .= " -libpath:".$_ for split /\s+/, opt(L);
  306.     my @mods = split /-?u /, $stash;
  307.     $link .= " ".ExtUtils::Embed::ldopts("-std", \@mods);
  308.     $link .= " perl5$Config{PERL_VERSION}.lib kernel32.lib msvcrt.lib";
  309.     vprint 3, "running $Config{cc} $compile";
  310.     system("$Config{cc} $compile");
  311.     vprint 3, "running $Config{ld} $link";
  312.     system("$Config{ld} $link");
  313. }
  314.  
  315. sub cc_harness {
  316.     my ($cfile,$stash)=@_;
  317.     use ExtUtils::Embed ();
  318.     my $command = ExtUtils::Embed::ccopts." -o $Output $cfile ";
  319.     $command .= " -I".$_ for split /\s+/, opt(I);
  320.     $command .= " -L".$_ for split /\s+/, opt(L);
  321.     my @mods = split /-?u /, $stash;
  322.     $command .= " ".ExtUtils::Embed::ldopts("-std", \@mods);
  323.         $command .= " -lperl";
  324.     vprint 3, "running $Config{cc} $command";
  325.     system("$Config{cc} $command");
  326. }
  327.  
  328. # Where Perl is, and which include path to give it.
  329. sub yclept {
  330.     my $command = "$^X ";
  331.  
  332.     # DWIM the -I to be Perl, not C, include directories.
  333.     if (opt(I) && $Backend eq "Bytecode") {
  334.         for (split /\s+/, opt(I)) {
  335.             if (-d $_) {
  336.                 push @INC, $_;
  337.             } else {
  338.                 warn "$0: Include directory $_ not found, skipping\n";
  339.             }
  340.         }
  341.     }
  342.             
  343.     $command .= "-I$_ " for @INC;
  344.     return $command;
  345. }
  346.  
  347. # Use B::Stash to find additional modules and stuff.
  348. {
  349.     my $_stash;
  350.     sub grab_stash {
  351.  
  352.         warn "already called get_stash once" if $_stash;
  353.  
  354.         my $taint = opt(T) ? '-T' :
  355.                     opt(t) ? '-t' : '';
  356.         my $command = "$BinPerl $taint -MB::Stash -c $Input";
  357.         # Filename here is perfectly sanitised.
  358.         vprint 3, "Calling $command\n";
  359.  
  360.         my ($stash_r, $error_r) = spawnit($command);
  361.         my @stash = @$stash_r;
  362.         my @error = @$error_r;
  363.  
  364.         if (@error && $? != 0) {
  365.             _die("$0: $Input did not compile:\n@error\n");
  366.         }
  367.  
  368.         # band-aid for modules with noisy BEGIN {}
  369.         foreach my $i ( @stash ) {
  370.             $i =~ m/-u(?:[\w:]+|\<none\>)$/ and $stash[0] = $i and next;
  371.             push @begin_output, $i;
  372.         }
  373.         chomp $stash[0];
  374.         $stash[0] =~ s/,-u\<none\>//;
  375.         $stash[0] =~ s/^.*?-u/-u/s;
  376.         vprint 2, "Stash: ", join " ", split /,?-u/, $stash[0];
  377.         chomp $stash[0];
  378.         return $_stash = $stash[0];
  379.     }
  380.  
  381. }
  382.  
  383. # Check the consistency of options if -B is selected.
  384. # To wit, (-B|-O) ==> no -shared, no -S, no -c
  385. sub checkopts_byte {
  386.  
  387.     _die("$0: Please choose one of either -B and -O.\n") if opt(O);
  388.  
  389.     if (opt(shared)) {
  390.         warn "$0: Will not create a shared library for bytecode\n";
  391.         delete $Options->{shared};
  392.     }
  393.  
  394.     for my $o ( qw[c S] ) { 
  395.         if (opt($o)) { 
  396.             warn "$0: Compiling to bytecode is a one-pass process--",
  397.                   "-$o ignored\n";
  398.             delete $Options->{$o};
  399.         }
  400.     }
  401.  
  402. }
  403.  
  404. # Check the input and output files make sense, are read/writeable.
  405. sub sanity_check {
  406.     if ($Input eq $Output) {
  407.         if ($Input eq 'a.out') {
  408.             _die("$0: Compiling a.out is probably not what you want to do.\n");
  409.             # You fully deserve what you get now. No you *don't*. typos happen.
  410.         } else {
  411.             warn "$0: Will not write output on top of input file, ",
  412.                 "compiling to a.out instead\n";
  413.             $Output = "a.out";
  414.         }
  415.     }
  416. }
  417.  
  418. sub check_read { 
  419.     my $file = shift;
  420.     unless (-r $file) {
  421.         _die("$0: Input file $file is a directory, not a file\n") if -d _;
  422.         unless (-e _) {
  423.             _die("$0: Input file $file was not found\n");
  424.         } else {
  425.             _die("$0: Cannot read input file $file: $!\n");
  426.         }
  427.     }
  428.     unless (-f _) {
  429.         # XXX: die?  don't try this on /dev/tty
  430.         warn "$0: WARNING: input $file is not a plain file\n";
  431.     } 
  432. }
  433.  
  434. sub check_write {
  435.     my $file = shift;
  436.     if (-d $file) {
  437.         _die("$0: Cannot write on $file, is a directory\n");
  438.     }
  439.     if (-e _) {
  440.         _die("$0: Cannot write on $file: $!\n") unless -w _;
  441.     } 
  442.     unless (-w cwd()) { 
  443.         _die("$0: Cannot write in this directory: $!\n");
  444.     }
  445. }
  446.  
  447. sub check_perl {
  448.     my $file = shift;
  449.     unless (-T $file) {
  450.         warn "$0: Binary `$file' sure doesn't smell like perl source!\n";
  451.         print "Checking file type... ";
  452.         system("file", $file);  
  453.         _die("Please try a perlier file!\n");
  454.     } 
  455.  
  456.     open(my $handle, "<", $file)    or _die("XXX: can't open $file: $!");
  457.     local $_ = <$handle>;
  458.     if (/^#!/ && !/perl/) {
  459.         _die("$0: $file is a ", /^#!\s*(\S+)/, " script, not perl\n");
  460.     } 
  461.  
  462.  
  463. # File spawning and error collecting
  464. sub spawnit {
  465.     my ($command) = shift;
  466.     my (@error,@output);
  467.     my $errname;
  468.     (undef, $errname) = tempfile("pccXXXXX");
  469.     { 
  470.     open (S_OUT, "$command 2>$errname |")
  471.         or _die("$0: Couldn't spawn the compiler.\n");
  472.     @output = <S_OUT>;
  473.     }
  474.     open (S_ERROR, $errname) or _die("$0: Couldn't read the error file.\n");
  475.     @error = <S_ERROR>;
  476.     close S_ERROR;
  477.     close S_OUT;
  478.     unlink $errname or _die("$0: Can't unlink error file $errname");
  479.     return (\@output, \@error);
  480. }
  481.  
  482. sub helpme {
  483.        print "perlcc compiler frontend, version $VERSION\n\n";
  484.        { no warnings;
  485.        exec "pod2usage $0";
  486.        exec "perldoc $0";
  487.        exec "pod2text $0";
  488.        }
  489. }
  490.  
  491. sub relativize {
  492.     my ($args) = @_;
  493.  
  494.     return() if ($args =~ m"^[/\\]");
  495.     return("./$args");
  496. }
  497.  
  498. sub _die {
  499.     $logfh->print(@_) if opt('log');
  500.     print STDERR @_;
  501.     exit(); # should die eventually. However, needed so that a 'make compile'
  502.             # can compile all the way through to the end for standard dist.
  503. }
  504.  
  505. sub _usage_and_die {
  506.     _die(<<EOU);
  507. $0: Usage:
  508. $0 [-o executable] [-r] [-O|-B|-c|-S] [-I /foo] [-L /foo] [-log log] [source[.pl] | -e oneliner]
  509. EOU
  510. }
  511.  
  512. sub run {
  513.     my (@commands) = @_;
  514.  
  515.     print interruptrun(@commands) if (!opt('log'));
  516.     $logfh->print(interruptrun(@commands)) if (opt('log'));
  517. }
  518.  
  519. sub interruptrun
  520. {
  521.     my (@commands) = @_;
  522.  
  523.     my $command = join('', @commands);
  524.     local(*FD);
  525.     my $pid = open(FD, "$command |");
  526.     my $text;
  527.     
  528.     local($SIG{HUP}) = sub { kill 9, $pid; exit };
  529.     local($SIG{INT}) = sub { kill 9, $pid; exit };
  530.  
  531.     my $needalarm = 
  532.           ($ENV{PERLCC_TIMEOUT} && 
  533.       $Config{'osname'} ne 'MSWin32' && 
  534.       $command =~ m"(^|\s)perlcc\s");
  535.  
  536.     eval 
  537.     {
  538.          local($SIG{ALRM}) = sub { die "INFINITE LOOP"; };
  539.          alarm($ENV{PERLCC_TIMEOUT}) if ($needalarm);
  540.      $text = join('', <FD>);
  541.      alarm(0) if ($needalarm);
  542.     };
  543.  
  544.     if ($@)
  545.     {
  546.         eval { kill 'HUP', $pid };
  547.         vprint 0, "SYSTEM TIMEOUT (infinite loop?)\n";
  548.     }
  549.  
  550.     close(FD);
  551.     return($text);
  552. }
  553.  
  554. sub is_win32() { $^O =~ m/^MSWin/ }
  555. sub is_msvc() { is_win32 && $Config{cc} =~ m/^cl/i }
  556.  
  557. END {
  558.     unlink $cfile if ($cfile && !opt(S) && !opt(c));
  559. }
  560.  
  561. __END__
  562.  
  563. =head1 NAME
  564.  
  565. perlcc - generate executables from Perl programs
  566.  
  567. =head1 SYNOPSIS
  568.  
  569.     $ perlcc hello              # Compiles into executable 'a.out'
  570.     $ perlcc -o hello hello.pl  # Compiles into executable 'hello'
  571.  
  572.     $ perlcc -O file            # Compiles using the optimised C backend
  573.     $ perlcc -B file            # Compiles using the bytecode backend
  574.  
  575.     $ perlcc -c file            # Creates a C file, 'file.c'
  576.     $ perlcc -S -o hello file   # Creates a C file, 'file.c',
  577.                                 # then compiles it to executable 'hello'
  578.     $ perlcc -c out.c file      # Creates a C file, 'out.c' from 'file'
  579.  
  580.     $ perlcc -e 'print q//'     # Compiles a one-liner into 'a.out'
  581.     $ perlcc -c -e 'print q//'  # Creates a C file 'a.out.c'
  582.  
  583.     $ perlcc -I /foo hello    # extra headers (notice the space after -I)
  584.     $ perlcc -L /foo hello    # extra libraries (notice the space after -L)
  585.  
  586.     $ perlcc -r hello           # compiles 'hello' into 'a.out', runs 'a.out'.
  587.     $ perlcc -r hello a b c     # compiles 'hello' into 'a.out', runs 'a.out'.
  588.                                 # with arguments 'a b c' 
  589.  
  590.     $ perlcc hello -log c       # compiles 'hello' into 'a.out' logs compile
  591.                                 # log into 'c'. 
  592.  
  593. =head1 DESCRIPTION
  594.  
  595. F<perlcc> creates standalone executables from Perl programs, using the
  596. code generators provided by the L<B> module. At present, you may
  597. either create executable Perl bytecode, using the C<-B> option, or 
  598. generate and compile C files using the standard and 'optimised' C
  599. backends.
  600.  
  601. The code generated in this way is not guaranteed to work. The whole
  602. codegen suite (C<perlcc> included) should be considered B<very>
  603. experimental. Use for production purposes is strongly discouraged.
  604.  
  605. =head1 OPTIONS
  606.  
  607. =over 4
  608.  
  609. =item -LI<library directories>
  610.  
  611. Adds the given directories to the library search path when C code is
  612. passed to your C compiler.
  613.  
  614. =item -II<include directories>
  615.  
  616. Adds the given directories to the include file search path when C code is
  617. passed to your C compiler; when using the Perl bytecode option, adds the
  618. given directories to Perl's include path.
  619.  
  620. =item -o I<output file name>
  621.  
  622. Specifies the file name for the final compiled executable.
  623.  
  624. =item -c I<C file name>
  625.  
  626. Create C code only; do not compile to a standalone binary.
  627.  
  628. =item -e I<perl code>
  629.  
  630. Compile a one-liner, much the same as C<perl -e '...'>
  631.  
  632. =item -S
  633.  
  634. Do not delete generated C code after compilation.
  635.  
  636. =item -B
  637.  
  638. Use the Perl bytecode code generator.
  639.  
  640. =item -O
  641.  
  642. Use the 'optimised' C code generator. This is more experimental than
  643. everything else put together, and the code created is not guaranteed to
  644. compile in finite time and memory, or indeed, at all.
  645.  
  646. =item -v
  647.  
  648. Increase verbosity of output; can be repeated for more verbose output.
  649.  
  650. =item -r 
  651.  
  652. Run the resulting compiled script after compiling it.
  653.  
  654. =item -log
  655.  
  656. Log the output of compiling to a file rather than to stdout.
  657.  
  658. =back
  659.  
  660. =cut
  661.  
  662.  
  663. __END__
  664. :endofperl
  665.